package org.chnxi.study.design.builder;

/**
 * 具体的对象实例建造实现
 */
public class Worker extends Builder {

    private Product product;

    public Worker() {
        product = new Product();
    }

    @Override
    Builder buildA(String arg) {
        product.setBuildA(arg);
        System.out.println("product.buildA = "+arg);
        return this;
    }

    @Override
    Builder buildB(String arg) {
        product.setBuildB(arg);
        System.out.println("product.buildB = "+arg);
        return this;
    }

    @Override
    Builder buildC(String arg) {
        product.setBuildC(arg);
        System.out.println("product.buildC = "+arg);
        return this;
    }

    @Override
    Builder buildD(String arg) {
        product.setBuildD("buildD");
        System.out.println("product.buildD = "+arg);
        return this;
    }

    @Override
    Product getProduct() {
        return product;
    }
}
